let t = parseInt(readline())
while(t--){
  let [n,...arr] = readline().split(' ').map(Number)
  let res = 0
  arr.forEach(v=>res+=v)
  print(res)
}